/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

/**
 *
 * @author kelyane
 */
public class Validadores {
    
    static public boolean validaStringAlpha (String string){
       return string.matches( "^([a-zA-Z]+ ?)+$" );
    }
    
    static public boolean validaRG(String string){
        return string.matches("^[0-9]+\\.[0-9]{3}\\.[0-9]{3}-[0-9]$");                
    }
    
    static public boolean validaCPF(String string){
        return string.matches("^[0-9]{3}\\.?[0-9]{3}\\.?[0-9]{3}-?[0-9]{2}$");
    }
    
    static public boolean validaEmail(String string){
        return string.matches("^[A-Za-z0-9._-]+@[A-Za-z]+\\.[A-Za-z]+$");
    }
    
    static public boolean validaTefone(String string){
        return string.matches("^([0-9]{2}) [0-9]{4}-[0-9]{4}$");
    }
    
    static public boolean validaInteiro(String string){
        return string.matches("^[0-9]+$");
    }
    
    static public boolean validaNotNull(String string){
        return string.matches("^.+$");
    }
    
    static public boolean validaHora(String string){
        return string.matches("^([01][0-9]|2[0-3]):[0-5][0-9]$");
    }
}
